package conn;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DBConnection {
	private static final String DBDRIVER = "org.sqlite.JDBC" ;
	private static final String DBURL = "jdbc:sqlite:PanServer.db3" ;
	
	public static Connection getConn_114(){
		try {
			Class.forName(DBDRIVER) ;
			return DriverManager.getConnection(DBURL) ;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
		
	}
	
	public static void close(Connection conn){
			try {
				conn.close() ;
			} catch (SQLException e) {
				e.printStackTrace();
			}
	}
	
	public static void close(Statement conn){
		try {
			conn.close() ;
		} catch (SQLException e) {
			e.printStackTrace();
		}
}
	
	public static void close(ResultSet conn){
		try {
			conn.close() ;
		} catch (SQLException e) {
			e.printStackTrace();
		}
}
	public static void main(String[] args) {
		Connection conn = DBConnection.getConn_114() ;
		System.out.println(conn) ;
		DBConnection.close(conn) ;
	}

}
